const express=require("express")
const router=express.Router();
const pool=require("../pool");
//fs fileSystem 文件系统
//创建文件 删除文件 修改文件 *移动*文件
const fs = require("fs");
//上传第三方模块
const multer = require("multer");
//创建upload对象
var upload = multer({dest:"upload/"});

//功能九：上传头像
router.post("/",upload.single("mypic"),(req,res)=>{
  var rows = [
    {code:1,msg:req.file.size},
    {code:2,msg:req.file.mimetype},
    {code:3,msg:req.file.originalname},
    {code:4,msg:req.file.path}
  ];
  res.send(rows)
})

module.exports=router;